<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

/**
 * This script returns jQuery.
 *
 * If debugging is off, the minified version is returned.
 * If debugging is on, the unminified version is returned.
 *
 * @package    local_rljquery
 * @link       http://jquery.com/
 * @author     Remote-Learner.net Inc
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 of later
 * @copyright  (C) 2013 Remote Learner.net Inc http://www.remote-learner.net
 */

require_once(dirname(__FILE__).'/../../config.php');
require_once(dirname(__FILE__).'/../../lib/filelib.php');

global $CFG;
$debug = $CFG->debug;
if ($debug > 0) {
    // If debugging is on in any capacity, send the unminified file.
    send_file('jquery.js', 'jquery.js', '0');
} else {
    // If debugging is off send the minified file.
    send_file('jquery.min.js', 'jquery.min.js', '31536000');
}